#ifndef MAINWIDGET_H
#define MAINWIDGET_H

#include "ui_MainWidget.h"
#include <QStringList>

class FastbootThread;
class MainWidget : public QWidget
{
    Q_OBJECT

    Ui::MainWidget *ui;
    FastbootThread *fastboot;

public:
    explicit MainWidget(QWidget *parent = 0);
    ~MainWidget();

private slots:
    void onDeviceListChanged(const QStringList &list);
    void on_deviceList_currentRowChanged(int currentRow);
    void on_browseBootloaderBtn_clicked();
    void on_browseKernelBtn_clicked();
    void on_browseRamdiskBtn_clicked();
    void on_browseSystemBtn_clicked();
    void on_browseUserdataBtn_clicked();
    void on_browseCacheBtn_clicked();
    void on_bootloaderGroup_clicked(bool checked);
    void on_kernelGroup_clicked(bool checked);
    void on_ramdiskGroup_clicked(bool checked);
    void on_systemGroup_clicked(bool checked);
    void on_userdataGroup_clicked(bool checked);
    void on_cacheGroup_clicked(bool checked);
    void on_writeBootloaderBtn_clicked();
    void on_writeKernelBtn_clicked();
    void on_writeRamdiskBtn_clicked();
    void on_writeSystemBtn_clicked();
    void on_writeUserdataBtn_clicked();
    void on_writeCacheBtn_clicked();
    void on_batchWriteBtn_clicked();
    void on_wrapBtn_clicked();
    void on_rebootDeviceBtn_clicked();

protected:
    void setSetting(const QString &key, const QVariant &value);
    QVariant getSetting(const QString &key,
                        const QVariant &defValue = QVariant());

    void loadSetting();
};

#endif // MAINWIDGET_H
